<div class="main-view"><!--最外层div-->
    <div class="left-margin top-margin"><strong class="am-text-primary am-text-lg">闪屏管理</strong></div>
    <form class="am-form-inline left-margin top-margin" role="form">
        <div class="am-form-group">
            <label for="splash_query_desc">描述</label> <input id="splash_query_desc" type="text" class="am-form-field" ng-model="splash_query.desc">
            <label for="splash_query_duration" ng-hide="true">停留</label> <input   ng-hide="true" id="splash_query_duration" type="text" class="am-form-field" ng-model="splash_query.duration">
            <label for="splash_query_startDate"  ng-hide="true">开始</label><input  ng-hide="true" id="splash_query_startDate" type="text" placeholder="开始日期" ng-model="splash_query.startDate"
                                                                 class="am-form-field model-input"
                                                                 .data-am-datepicker
                                                                 data-am-datepicker="{format: 'yyyy-mm-dd hh:ii',viewMode: 'days', minViewMode: 'days'}"
                                                                 >
            <label for="splash_query_endDate"  ng-hide="true">结束</label>  <input  ng-hide="true" id="splash_query_endDate" type="text"   class="am-form-field model-input"
                                                                 .data-am-datepicker
                                                                 data-am-datepicker="{format: 'yyyy-mm-dd hh:ii',viewMode: 'days', minViewMode: 'days'}"
                                                                 ng-model="splash_query.endDate" placeholder="结束日期">
        </div>
        <button type="submit" class="am-btn am-btn-primary" ng-click="searchSplashScreen()" data-target = "cascad-search">搜索</button>
    </form>
    <br>
    <div class="am-btn-group am-btn-group-xs left-margin top-margin">
        <button type="button" class="am-btn am-btn-default" data-am-modal="{target: '#doc-modal-splash', width: 800, height: 520}" ng-click="initSplashAdd()"><span class="am-icon-plus"></span>添加</button>
        <!--<button type="button" class="am-btn am-btn-default" ng-click="delete()"><span class="am-icon-trash-o"></span> 删除</button>-->
    </div>
    <div id="pagination" class="pagination"></div>
    <div class="pagination-table left-margin" id="tab_menu" style="margin-top: 0px;">
        <form class="am-form">
            <table class="am-table am-table-striped am-table-hover table-main">
                <thead>
                <tr>
                    <!--code,name,url,(avg,max),(avg,max)-->
                    <!--<th class="table-check"><input type="checkbox"></th>-->
                    <th class="table-title">开始</th>
                    <th class="table-title">结束</th>
                    <th class="table-title">图片</th>
                    <th class="table-title">描述</th>
                    <th class="table-title">停留</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat='splash in splashList' id="{{splash.objId}}">
                    <!--<td class="table-check"><input type="checkbox" class="item-check"></td>-->
                    <!--2016-01-06 00:00-->
                    <td>{{splash.startDate | date:'yyyy-MM-dd hh:mm'}}</td>
                    <td>{{splash.endDate | date:'yyyy-MM-dd hh:mm'}}</td>
                    <td>
                        <!--ng-click="clickBigPic($event.target, splash.image)"-->
                        <img ng-show="splash.image!=null"  ng-src="{{splash.image}}" width="48" height="78" onerror="this.style.display='none'">
                    </td>
                    <td>{{splash.desc}}</td>
                    <td>{{splash.duration}}</td>
                    <td>
                        <div class="am-btn-toolbar">
                            <div class="am-btn-group am-btn-group-xs">

                                <button data-am-modal="{target: '#doc-modal-edit', width: 1000, height: 520}"
                                         ng-click="editSplash(splash)"
                                        class="am-btn am-btn-default am-btn-xs am-text-secondary">
                                    <span class="am-icon-copy"></span>编辑
                                </button>
                                <button ng-click="delSplashScreen(splash.objId,$index)"
                                        class="am-btn am-btn-default am-btn-xs am-text-secondary">
                                    <span class="am-icon-copy"></span>删除
                                </button>
                            </div>
                        </div>
                    </td>
                </tr>
                </tbody>
            </table>
        </form>
    </div>
    <div class = "left-margin">共<span id = 'page_number'>{{pageNumber}}</span>页 <span>{{count}}条数据</span></div>


    <!--新增-->
    <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-splash">
        <div class="am-modal-dialog">
            <div class="am-modal-hd border-bottom" style = "text-align: left;">闪屏画面
                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
            </div>
            <div class="am-modal-bd body-area">
                <div class="text-left" style="width:90%">
                    <form class="am-form">
                        <fieldset  class="am-form-set">
                            <div class="am-form-group am-u-sm-4">
                                <label for="start_date">开始日期</label>
                                <input ng-model="splash_.startDate" id="start_date" type="text" placeholder="开始日期"
                                       class="am-form-field modal-input" data-am-datepicker="{format: 'yyyy-mm-dd hh:MM'}" readonly required/>
                            </div>

                            <div class="am-form-group am-u-sm-4" >
                                <label for="end_date">结束日期</label>
                                <input required ng-model="splash_.endDate" type="text"  id="end_date" class="am-form-field modal-input"
                                       data-am-datepicker="{format: 'yyyy-mm-dd hh:MM'}" placeholder="结束日期" readonly>
                            </div>


                            <div class="am-form-group am-u-sm-4">
                                <label for="end_date" ng-model="splash.desc" >闪屏持续时间</label>
                                <input ng-model="splash_.duration" type="text"  id="splash.duration" class="text-info" placeholder="以秒为单位，例如 2">
                            </div>

                            <div class="am-form-group am-u-sm-12">
                                <label for="end_date" >闪屏描述</label>
                                <input ng-model="splash_.desc" type="text"  id="splash_.desc" class="text-info">
                            </div>

                            <div class="form-group am-u-sm-4">
                                <label class="control-label"  style="width:200px" for="textinput">商品图片(最多可上传1张):</label>
                                <input type="file" id="images_upload"
                                       onchange="angular.element(this).scope().selectFile(this.files,'add')" multiple accept="image/*">
                                <div id="image_result" class="image-result"></div>
                            </div>
                            <!--ng-click='addSplashScreen(splash_)-->
                            <div class = "button-area border-top">
                                <button type="submit" class="am-btn am-btn-success right-margin top-margin" ng-show="true" ng-click='addSplashScreen(splash_)'>添加</button>
                            </div>
                        </fieldset>
                    </form>
                </div>
            </div>

        </div>
    </div>


    <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-edit">
        <div class="am-modal-dialog">
            <div class="am-modal-hd border-bottom" style = "text-align: left;">更新闪屏
                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
            </div>
            <div class="am-modal-bd body-area">
                <div style = "width: 90%;" class = "text-left">
                    <form class="am-form">
                        <fieldset class="am-form-set">
                        <div class="am-form-group am-u-sm-4">
                            <label for="start_date_edit">开始日期</label>
                            <input ng-model="splashEdit.startDate" id="start_date_edit"
                                   type="text" placeholder="开始日期"
                                   class="am-form-field model-input"
                                   .data-am-datepicker
                                   data-am-datepicker="{format: 'yyyy-mm-dd hh:ii',viewMode: 'days', minViewMode: 'days'}"
                                   readonly required/>
                        </div>

                        <div class="am-form-group am-u-sm-4" >
                            <label for="end_date_edit">结束日期</label>
                            <input  ng-model="splashEdit.endDate" type="text"  id="end_date_edit" .data-am-datepicker class="am-form-field modal-input" data-am-datepicker="{format: 'yyyy-mm-dd hh:ii',viewModel:0}" placeholder="结束日期" readonly required>
                        </div>
                        <div class="am-form-group am-u-sm-4">
                            <label>停留</label><input type="text"  ng-model="splashEdit.duration" required>
                        </div>
                        <div class="am-form-group am-u-sm-12">
                            <label>描述</label><input type="text"  ng-model="splashEdit.desc">
                        </div>

                        <div class="form-group am-u-sm-12">
                            <label class="control-label"  style="width:200px" for="textinput">商品图片(最多可上传1张):</label>
                            <input type="file" id="images_upload_edit"
                                   onchange="angular.element(this).scope().selectFile(this.files,'scoreShopUpdate')" multiple accept="image/*">
                            <div id="image_result_edit" class="image-result"></div>
                        </div>
                        </fieldset>
                    </form>
                </div>
            </div>
            <div class = "button-area border-top">
                <button type="submit" class="am-btn am-btn-success right-margin top-margin" ng-show="true" ng-click="editSplashScreen(splashEdit)">更新</button>
            </div>
        </div>
    </div>

    <!--加载中-->
    <div class="am-modal am-modal-loading am-modal-no-btn" id="loading">
        <div class="am-modal-dialog">
            <div class="am-modal-hd">正在载入...</div>
            <div class="am-modal-bd">
                <span class="am-icon-spinner am-icon-spin"></span>
            </div>
        </div>
    </div>

<script>

   $('#start_date').datetimepicker('setStartDate', new Date()).on('changeDate', function (ev) {
        $('#start_date').datetimepicker({
            format: 'yyyy-mm-dd hh:ii'
        });
    });

   $('#end_date').datetimepicker('setStartDate', new Date()).on('changeDate', function (ev) {
        $('#end_date').datetimepicker({
            format: 'yyyy-mm-dd hh:ii'
        });
   });


//更新闪屏时段


    $('#start_date_edit').datetimepicker().on('changeDate', function (ev) {
        $('#start_date_edit').datetimepicker({
            format: 'yyyy-mm-dd hh:ii'
        });
    });


    $('#end_date_edit').datetimepicker().on('changeDate', function (ev) {
        $('#end_date_edit').datetimepicker({
            format: 'yyyy-mm-dd hh:ii'
        });
    });

    $('#splash_query_startDate').datetimepicker().on('changeDate', function (ev) {
        $('#splash_query.startDate').datetimepicker({
            format: 'yyyy-mm-dd hh:ii'
        });
    });
    $('#splash_query_endDate').datetimepicker().on('changeDate', function (ev) {
        $('#splash_query.startDate').datetimepicker({
            format: 'yyyy-mm-dd hh:ii'
        });
    });


    </script>
</div>